import type { Metadata } from "next"; import { notFound } from "next/navigation"; import { getLocale } from "@/lib/i18n/server"; import { t } from "@/lib/i18n"; import { getMethod, listPapers } from "@/lib/papers/queries"; import { PaperRow } from "@/components/paper-items"; export const revalidate = 300; export async function generateMetadata({ params }: { params: Promise<{ slug: string }> }): Promise { const { slug } = await params; const x = await getMethod(slug); const locale = await getLocale(); return x ? { title: locale === "fr" ? x.name_fr : x.name_en, alternates: { canonical: `/methods/${slug}` } } : {}; } export default async function MethodPage({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params; const locale = await getLocale(); const d = t(locale); const x = await getMethod(slug); if (!x) notFound(); const res = await listPapers({ method: [slug], sort: "recent", perPage: 100 }); return (

{d.papers.method} ยท {x.category}

{locale === "fr" ? x.name_fr : x.name_en}

{(locale === "fr" ? x.description_fr : x.description_en) &&

{locale === "fr" ? x.description_fr : x.description_en}

}

{res.total} {res.total === 1 ? d.topics.paper : d.topics.papers}

{res.items.map((p) => )}
); }